Move function to thread ralated class