Refactor drawX.