Update documentation
Move functions to separate files