At some point I'd like to introduce https://github.com/liteguard/liteguard which will take care of all of this stuff for us.