Use Logger instead of puts