refactor warning check