Code is refactored to pass style checks