Move functions into their own directory