General purpose extension methods.