Cleaning up threads, adding thread parameter