Refactroing of back end entity model to be more flexible