Cleaned main method.