Write a real parser for the grep output
Do more validation