Cleaning up some duplication pointed out by CodeClimate