This looks wierd, let's discuss. Seems like threading can make this better.