Template completion improvements