Can you please review the changes I made ? Not sure if it makes it cleaner and simpler.
I am still coming to grips with scala, so I am sure there must be better ways to do it !