updated the abstract factory sample implementation