cleaned up parsing