Add middleware and attributes class