COOPR-605: refactored code