EN-2434: minor fixes + refactoring