Moved helper functions to their own files.
Added get_constraints function