Replaced System.out.println()s with proper logging.