Migrated from node to client js