refactored positioning in the Entity class