Get rid off System.out and delete unused code