generalize view loading