simplify JavaScript API