Add flexibility to state entry and exit callbacks