refactored card reader code mainly such that timeouts happen at the implementation level