SOC-3006: Refactor code