Refactoring into smaller methods.
Bug: Function parameter was not being used.
Refactoring into smaller methods.