Replace in-memory filter with database query
Fix test method names