refactoring to samew format