Main() updated

Uses object factory to create all necessary instances