manual ugly parsing