init with middleware, views