Improved UOW logic