Updated code to use new PINManager class