Split out helper functions more