Refactor process to fix frozen hash issue