example middleware object using methods