Template implementation.