Logger facotry and fixes