merged input handler and render handler