Moved the structure of the file into smaller pieces with loose coupling