Change to use Thread directly