fix thread sleep time calculation, removed unused method