Move __middleware__ to module.