cg: trying internal helper, but bugs, so started write unit tests