refactoring: split into modules