refactor and fixing checkstyle issues that were preventing the build