refactored applink, main, and recommendations