move logs processing to its own file