Phase 2 done
Split up code into files