huge refactoring to be able to change transitions without subclassing