helper functions for client