checkstyle and remove useless code