Use JOIN query instead of that other thing