js abstraction