Clean up parsing (#18), although this still needs work