Changed interfaces to classes to aid understanding