refactoring to meet DEFI standards