more js refactor

Updated some js methods for clarity