do not separate threaded function to different class, this just messes things