refactor draw table, thanks Brandon