consolidating JS