Refactor: move each type to different files