revamp as nodeJS module