Refactored js files from activity template