Refactor a few classes into packages.