extracted middleware and registry - improved readme