Use a structure to store shared data.
Best practices, ho!
Use caffeinate and pkill in handlers.
Use a channel for tracking PMS state.