Remove unused methods from mainobject class.