cleanup: remove duplicate code
use os.devnull instead of '/dev/null'