refactor: module separation, file structure, etc (much better now)