create more robust interface for generic js wrapper