Consider improving your deign to make non-trival functions testable.