Mostly code simplification and new helper functions.