Code cleanup, cleaner service and middleware registration.