CAS-1468: refactoring based on PR comments