worker_is_primary config change, separate data input/output dirs and minor refactoring