refactor and add checkstyle,pmd