Improved EntityLoader code