refactored nested do in createShoe
refactored pipe to a sharedPipe. Refactored runA to take care of Errors. Added type declarations for readbility