Rewriten medit using new architecture