modify models/user.php, decouple database functions from controller