[DF-3553] refactor code