refactored workshop JS