Update widget type validation
Remove System.out
Java code refactoring