Added checkstyle, partial refactoring for conformity