Refactored the fork block code into child_job method