Adding inheritance and giving more independence to the classes