refactor to support ARC, 64-bit, iOS7