gateway utility functions.