move functions into one file