split off helper functions