Refactor main and processJobs for manifest usage