moved classes into packages and encapsulated fields