Cleaned up the templating