more elegant handling of blocks