parse and lookup code