Adde policy builder and inline helper along with a bunch of minor fixes