Move some code around
Reorder some SQL stuff
Tweak some styles and ids