core-4300 refactor code