simplifying state machine
starting tests for train
third refactoring, extract state pattern