refactor Resource Entity, remove unused fields, and remove uid from all entities