Some refactoring and small bug fixing.
Refactored sentence building.