More clear implementation of Allocate/Realize handlers.