Tidy up of code now it's public... Obvious I don't know how to code!