Add a constructor that accepts configuration object