refactor way that object ids are created and reused