use state machine
add a lot of pending spec to write it