refactor path factory