Clean up code. Moved templates to their own repos.