Refactor recommender out of main, fix error msg etc