first helper functions