a more elegant method to get sentence