WF-1595 - Fixed, Enhanced code for better processing