separating form and view logic more cleanly