Lots of refactoring to make it cleaner and easier to extend. Now Application and Container have clear roles and the main file does only very little.