Refactoring to remove duplicate code.
Refactoring to remove duplicate code.
Optimization.