Used objectfactory rather than manually create instances