Yes. I wrote this code in another patch and now I realize the BlockId object already handles this.