factor stereo drawing code into single function