improve quality: checkstyle, PMD and bugs