General purpose helpers.