Optimized queries in ApplicationController#index