refactoring techniques applied