Neaten up queries and make view less complex