gui working with html - some refactor