Moved higher order types out of the main source file, which should be restricted to core functions