lots of changes to comply with checkstyle rules