refactor html to separate concerns and interfaces