inrtoduce block passes. move the allocation there and implement those simple optimisations