Using setproctitle; refactoring