Fix more code smell issues and linter warnings