Improved main controller