cud refactored