Refining UNIX code