re-worked actions/middleware