Fix code smells

Based on PullReview: [List of fixed issues](https://www.pullreview.com/github/24pullrequests/24pullrequests/movers/pulls/pull_request_644).

cf #622