Few miscellaneous cleanups to simplify logic