Streamline main's code.