It's also not good to use three different words "decode", "allocate" and "assign" for the same purpose. It would be confusing for people who reads the code in future.