Working on transitions, refactoring