task history get updated on a background thread

also start task history refactoring