refactoring
diagnostic logging