Johnathan weisner refactor js