Handle private fields and switch to using the primary key as the key in HashMap instead of the object