Transition function instead of State's method

With this PR we relax the necessity of re-defining state variables in child classes.
Here we go. I also added the exception on setting the state.