wrote specs, refactored some templates, cleaned code