Refactored classes. Set to be mockable.