Some loops cleaned up