Refactoring process code