Extract instrument to directive and template.