add template and route support