Take input processing out of update function