moved shape drawing functions to a factory
moved shape drawing functions to a factory