updating map js to a class