minor refactoring. [skip ci]