Tidy up a little
Do all sql in one go
Change order