refactoring to keep old code style