refactor javascript methods into workforces folder from view