Refactor code to improve code quality.