Refactoring markup into data