Cleaned up main ctrler