ARC Refactoring

I refactored the example and leaves library to support ARC.