EPG-34244 - refactored the code with current epagesj version