some utilities for patching purposes