refactor: remove dead code and extract module