change constructor parameters to be an option object instead.