Refactored classes into more logical packages to keep things tidy.