separating js concerns