ported from meta