abstracting thread states