Done some cleaning in the code