some clean up.
Added controller actions and templates.