refactored angular for page selection