refactored domain scripts