Major cleanup of parse()