Compose templates properly