Use new codes based on block ownership
Also use type defined in definitions.h