breaking logic into categories