master controller and loading directive improvement