added simpler transition definition
remove unused variable
slight refactor