Added Checkstyles config to build, refactored code to remove checkstyle errors.