fix a bug in tests
refactor out recommendations implementations