WIP
simplification of do_push_state
WIP