Helper functions.