Avoiding n+1 problems