Removed unused parameter.
Refactoring.
Refactoring.
Move some logic to Utils module.