refactor path related stuff