Inline single use functions, remove globals, add central notify