refactor with checkstyle warnings/errors