code quality refactoring