Refactored the stitching of objects using various arrays