improve JS abstractions