Some much needed cleanup and refactoring, still stuck on the modfx values