Refactored code to be easier to navigate
Fixed crash bug where cursor went out of range
When not active now choices don't receive events