Refactor dialog drawing (extract method.)