move helper functions to separate folder