Unified and simplified usage of some classes. Cleaned up also.