Refactored module to make easily portable. Also removed params options