change second arg to constructor to be opts