modularizes js in capture.html