refactor(*): refactor client-side code into modules