Change javascript file to reflect responsibilities