Refactored and commented Entity class