added enum utils code generator
added set_state `if` to a main processing method