refactored drmModal