Initial code base ported from private repo