use threads to improve performance with multiple clients