Test performance tweaks
Rewrite conditions as a dict of lambdas