Simplify path encoding/decoding