Refactoring to methods.
Refactoring to methods.
Added comment describing the method.