li386 refactoring