replaced the raw query for a fluent one