Replace BSD mtod with inline logic