adapted changes for refinery integration