fix warning

* code refactoring