More loops cleaned up