integrate refactored code into oppy core