Beautify code and remove much debugging helpers.