Normalise some code style
Fix multiple connection query caching