create view loading logic and globals