Delete useless debug sub and cleaning the code