reduced duplication in class methods
reduced some duplication in instance methods
reduced some more duplication in instance methods