Move some functions from Popl to Framework