Changed queries to strong typed queries