Unified function to use.  The other functions will be switched to use this.