Replaced printlns with logging calls.