Refactoring and add ReturnEntryListener.