freerds: refactoring and improved path management