Removed unused functions, removed unnecessary global declarations, improved transition execution
Improved transition execution