refactor draw method