added context to constructors to allow sharing