Tidying piquant.py - marginal improvement over giant if statement?