code cleanup in entities