Fix code smells

Based on PullReview

cf #622