Refactor dom structure creation for deck view