this api is almost privately used