     }
 }
 
-private func PathForDrawingBoxAnnotation(_ annotation: BoxAnnotation) -> UIBezierPath? {
-    let frame = annotation.frame
-    let strokeWidth = annotation.strokeWidth
-    let borderWidth = annotation.borderWidth
-    let cornerRadius = annotation.cornerRadius
+private extension BoxAnnotationView {
     
-    let outerBox = frame.insetBy(dx: strokeWidth, dy: strokeWidth)
-    let innerBox = outerBox.insetBy(dx: borderWidth + strokeWidth, dy: borderWidth + strokeWidth)
-    
-    if min(innerBox.size.height, innerBox.size.width) < (borderWidth + strokeWidth) * 2.0 {
-        return nil
+    private static func path(forDrawing annotation: BoxAnnotation) -> UIBezierPath? {
+        let frame = annotation.frame
+        let strokeWidth = annotation.strokeWidth
+        let borderWidth = annotation.borderWidth
+        let cornerRadius = annotation.cornerRadius
+        
+        let outerBox = frame.insetBy(dx: strokeWidth, dy: strokeWidth)
+        let innerBox = outerBox.insetBy(dx: borderWidth + strokeWidth, dy: borderWidth + strokeWidth)
+        
+        if min(innerBox.size.height, innerBox.size.width) < (borderWidth + strokeWidth) * 2.0 {
+            return nil
+        }
+        
+        if min(innerBox.size.height, innerBox.size.width) < cornerRadius * 2.5 {
+            return nil
+        }
+        
+        let firstPath = CGPath(roundedRect: innerBox, cornerWidth: cornerRadius, cornerHeight: cornerRadius, transform: nil)
+        let secondPath = CGPath(copyByStroking: firstPath, transform: nil, lineWidth: borderWidth + strokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 100)
+        
+        guard let strokePath = secondPath else { return nil }
+        
+        let path = UIBezierPath(cgPath: strokePath)
+        path.lineWidth = strokeWidth
+        path.close()
+        return path
     }
     
-    if min(innerBox.size.height, innerBox.size.width) < cornerRadius * 2.5 {
-        return nil
-    }
-    
-    let firstPath = CGPath(roundedRect: innerBox, cornerWidth: cornerRadius, cornerHeight: cornerRadius, transform: nil)
-    let secondPath = CGPath(copyByStroking: firstPath, transform: nil, lineWidth: borderWidth + strokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 100)
-    
-    guard let strokePath = secondPath else { return nil }
-    
-    let path = UIBezierPath(cgPath: strokePath)
-    path.lineWidth = strokeWidth
-    path.close()
-    return path
-}
-
-private func PathForPointInsideBoxAnnotation(_ annotation: BoxAnnotation) -> UIBezierPath? {
-    let outsideStrokeWidth = annotation.borderWidth * 2.0
-    
-    return PathForDrawingBoxAnnotation(annotation)
-        .flatMap { path in
-            CGPath(copyByStroking: path.cgPath, transform: nil, lineWidth: outsideStrokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 0)
+    private static func path(forPointInside annotation: BoxAnnotation) -> UIBezierPath? {
+        let outsideStrokeWidth = annotation.borderWidth * 2.0
+        
+        return path(forDrawing: annotation)
+            .flatMap { path in
+                CGPath(copyByStroking: path.cgPath, transform: nil, lineWidth: outsideStrokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 0)
+            }
+            .map { path in
+                UIBezierPath(cgPath: path)
         }
-        .map { path in
-            UIBezierPath(cgPath: path)
     }
 }

        fatalError("init(coder:) has not been implemented")
    }


    // MARK: - UIView

    override public func tintColorDidChange() {

    override var annotationFrame: CGRect? {
        return annotation?.frame
    }

    // MARK: - Initializers

