Refactored script that configures PATH