Reorder code in prover to make it more readable + solve IDESlave protocol failure on prover errors