Cleanup. Add templates.
Cleanup. Remove outdated code