reorganize and document some parts of the app