Clean up director template
Clean up on SD code