core-5303 refactor code