backporting gramework
draft framework backported from ubilling