refactor popup page