Added checkstyle, refactored for checkstyle conformity, some additional refactoring