master page and some basic logic