Simplify block_alloc function