rework of InputState