move problem-handling logic to separate module