separating all js methods