cleaned up the context menu state and made simpler (nore JS-normal)
bindings for callbacks