Split out functions into their own file