     @IBInspectable var enableRemoveButton: Bool = false {
         didSet {
             removeButton.hidden = !enableRemoveButton
-            
-            if enableRemoveButton {
-                titleEdgeInsets.right = paddingX + removeButtonSize
-            }
-            else {
-                titleEdgeInsets.right = paddingX
-            }
+            updateRightInsets()
         }
     }
     
     @IBInspectable var removeButtonSize: CGFloat = 12 {
         didSet {
             removeButton.iconSize = removeButtonSize
-            if enableRemoveButton {
-                titleEdgeInsets.right = paddingX + removeButtonSize
-            }
+            updateRightInsets()
         }
     }
     

    }
    
    // MARK: - layout
    
    override public func intrinsicContentSize() -> CGSize {
        var size = titleLabel?.text?.sizeWithAttributes([NSFontAttributeName: textFont]) ?? CGSizeZero

    @IBInspectable var paddingX: CGFloat = 5 {
        didSet {
            titleEdgeInsets.left = paddingX
            updateRightInsets()
        }
    }

    @IBInspectable public var tagBackgroundColor: UIColor = UIColor.grayColor() {
        didSet {
            backgroundColor = tagBackgroundColor
