Refactor to avoid double state tracking
Push semantics
Add basic tests