refactoring done to align with UI
refactored to match GUI - commit-2