Feel free to leave this, but I would considered doing this in a try-except-else and have ```register()``` raise an exception on failure instead of relying on return values.