performance improvements, support BSD