Further refactorings

Take THAT CodeClimate