Moved registerUser into user.php, added transactions