Extracted widget view code to view file.