Neha, D3| #1937 | Moved common code to helper. Added opt parse