Refactor these 2 procs.