Rewritten all js code for subjects