DRY way to register callbacks.
Used more pythonic ways for various checks.