Re-aranging classes. Code cleanup.