fixed bug with livereload
refactor and polish