migrate log stuff to module