Refactored SearchCommand
Updated ViewCommand for flexibility
Fix test cases due to change in format

However correctness is not checked.