Write thunks separately from other atoms - this can still be improved by not using atoms at all, but one thing at a time.