refactoring undecoded path code