refactored review generation and added some tests