restructure so as to not include metro code in main page code