Support of rich content in label and some refactoring