Refactored Entity Helper to support optional id