runtime: refactor top/hier block python wrappers