Moved redundant code out of WD