Refactoring following some of CodeClimate wierd rules