implementation with 2 classes
implementation with inner classes