added a common entityize function to prevent the contining spread