Updated implementation to behave more closely to Mozilla's JSM design