[misc] Refactoring to pass checkstyle