Refactored Pathname module by using Base.protectx