separating out form view from template view, refactor