The many helper functions for logic-awareness