BF: missing dollar for macports; a little refactor