Optimizations and start of plugin architecture