code tidy up - remove unused code, fix spelling, comments