 ) ->
   React.createClass
     mixins: [Cursors]
-    # TODO maybe extract into helper function
-    # TODO make it easy to sync an entire form with the state
-    updateIdentifier: (event) ->
-      this.update
-        page:
-          identifier:
-            $set: event.target.value
-    updatePassword: (event) ->
-      this.update
-        page:
-          password:
-            $set: event.target.value
+    handleChange: (event) ->
+      command =
+        page: {}
+      command.page[event.target.name] = $set: event.target.value
+      this.update command
     handleClick: (event) ->
       event.preventDefault()
       console.log 'ComponentLogin', 'handleClick', event

                      placeholder: 'Password'
                      name: 'password'
                      value: that.state.page.password
                      onChange: that.updatePassword
                    }
                  k.button {
                    type: 'submit'

                      placeholder: 'Email or username'
                      name: 'identifier'
                      value: that.state.page.identifier
                      onChange: that.handleChange
                    }
                  k.div {className: 'form-group'}, ->
                    k.label {htmlFor: 'inputPassword'}, 'Password'
