remove logging, yet more refactoring