Remove duplicate code

The createSprite(), createPatch() and findRegion() methods had a lot of identical code
 that could be simplified