made function non-exported, internal api only