move helper functions one level up