Pulling out some redundant code in the shed functions