Code cleanup and fixed some checkstyle violations