cleaned up html and put code into separate files