Code cleanup for JS visualization