fix typo in previous commit
refactor some rect drawing