Simplify final state transitions with a macro