Refactor types into their own files.