split into file types

split the functionality into html and js