Changing the class definitions to support encapsulling(not sure if that's the name)