refactor method database.ModernQuery.join