refactor account confirmation for foundation