Tidy up of project code

Hi Mark,

Saw your message on the Bristol DBUG page and thought I would make a few small changed just to make your app a little tidier. Hopefully the comments in the commits will explain the reason behind the changes (Essentially they are just best practise changes).

Keep up the good work.

Matt