add procedure style js-api
add procedural abstraction