View initialization code moved into its own method.