Refactor code to be cleaner and have less coupling. Add code to reset some properties and internal tracking for listeners.