Refactored loading bar into its own directive