use object as constructor parameter