Refactor code. Implement errors graph.