The original code uses state but I'm trying to move away towards Id or StateId since since the actual instance is a State object. I'll change all occurances in this function at least.