Cleaned the scope of functions and methods.