Refactor to remove global PROG