Refactor path stuff