Clean up dead code and rename kw lookups