Refactoring: extract classes to files. Minor changes.