Add helper functions to make demo work properly