[update] refactoring into module pattern and rethinking the variables