moved client-side decision logic into its own subfolder