Refactor types into separate files.