Refactored for ARC and iOS6