add state helpers and view callbacks