Refactoring Entity class

Signed-off-by: Fabien Crassat <fabien@crassat.com>