split out functions into a separate file