move click handler and rest of rendering code into tile/