Clean up parse() function