replaced explicit threads with futures