Refactored code, added more class descriptions.