Added preliminary custom entity handling