cleaned up code into main and classes with flask folder
cleaned up code into main and classes with flask folder