Refactoring process.php