modal code clean up for recommendations