Implement utils module and refactor.