Fewer sql queries

does it make sense here to fold this into an instance of format ... call methods that correspond to format instead of having a dictionary lookup?