improved template markup