restructured to remove flask script