refactoring & fix code style