moved rescast functions to the resource header