refactoring + allowing logging of primitive types and Objects