refactor DrawPattern -- stage 1