prepare logic for entities