Improve Main class.