Refactoring touch master/detail template.