Refactor for CodeClimate.