Various cleanup, renamed parsing function