I am aware of the function, using it is uninformative as to what's in the slot, which makes it impossible to insert the id.  You're right that the code duplication is an issue, I'll think about it.