more refactoring for code climate