removed helper function