refactoring constraint_handler part 2. actually defining the class methods