improved flow logic: by request -> by cookie -> by request method
refactoring app model