Sustainable transformation of a refinery