refactor(job/unit): rework template/instance logic