Updated to use Entities