Completed better implementation for entity