Refactored the code to use ARC.