Library: Refactoring of markup code