refactor the common code for page object capital index page to a separate file