cleaned up main template