Useful extension methods.