DanielleSucher/Nantucket — pull request #4 by martindemello (2012-04-14 10:39:34+00:00)
Title: bunch of small refactorings

Mostly removing code duplication, though there's one significant performance speedup where i get rid of the calls to list.remove() (which is very expensive)

Also I've applied the refactoring where

if (condition):
large block of code
else:
handle error

becomes

if (not condition):
handle error
exit

large block of code

which is easier to read and maintain as the code gets more complex.