Replaced the method contents with a dict lookup.

All tests still pass.