Improved queries so that they become faster