Improve main main layout template
More setup and organizing