Clean up and switch to lru-cache