Cleaned up patch rendering logic