refactor sognup.php