Code cleaning part 2

Main_function.js