move the global function to sprite member