Refactor password code into pass.php