Being state-tracking implementation
Lack of tests was driving me crazy