Split out code into seperate files
Removed header