Use threading instead of function composition