Break solving logic into its own class