AUTO-496 fix warnings. refactor