Refactored classes into proper structure