Logdir access check, small refactors

codemaid changed a bunch of files