misc
Remodeled middleware architecture
Cleanup