CE-340 Simplifying query