Refactoring from CodeClimate