A reorder of the files and clean up the code to easy digest