fixes and html refactoring