[refactor] refactor main module according to documentation