Why move this all out seems this patch can be condensed into what.. 4 lines if done right here...