changed constructor signature to use options object