moved registerLoader/refresh to top