moved input callbacks to their own state.