Clean up the code to get rid of ipdb call [ci skip]