more restructuring to be more in line with flask docs