Improve JS API