Splitting into templates and tidy