Initial separation of functions into separate files