switched query to use mostly scopes