Eliminating some code duplication gripes surfaced by CodeClimate