Jinwen [Ruler-1]: do some refactorings