Use query to load nodes instead of entity_load function. Only load fields which are used.
Added debug logging.