Tidy up more files
Refactor code and separate out examples