improved entity lifecycle management
first step to add tests