TS-70 - refactor html templates, fix bugs, improve error states