Extracting view content and putting it into the layout