Code improvement in plan datamodel

Fixes bug 1295317

Change-Id: Ibe3b3ca617738ddaeb2764502157308d1defd1a7
Merge "Code improvement in plan datamodel"