code refactoring to match the proposed coding style