Splitting up and more work on logging