refactored to use dependency injection instead of inheritance
adding docs