Add middleware phases