restructued for demo