Cleaned up class structure for better legibility, maintenance.