massive refactoring, content loading and loading indicator