refactored classes and added examples