Reducing queries on "set" method