improve code metric refactoring