add code climate and remove duplication