moved stuff out of parse()