Updated entity framework