cleanup templates and routing