Porting iOS code to state-machine-based product management