adjusted for use in jsWire project