Refactor: move types to separate files.