Cloud side already does something like this (that's where I stole it from...)