code cleanup and moved "rendering" into .shape()