move overlay functions to native