Dramatically simplified code with advanced shape init.