#16 improved template