Move classes to their own files and fix encoding issue.