move functions to a single file