moved more helper functions