moving functions to a module