Split files and add documentation