[WIP] Extract common functionality to xblock-utils