SOFTWARE REFACTORING USING PATTERN RECOGNITION TECHNIQUES