remove reference to application package & Emit toggle event when visibility of layer is changed