Improve path implementation