factor out the rendering code so I can animate between board states