Reorganization, put logging in a class