Refactored the classes into different packages.

Pull request test.