extracted logic into its own class
extracted logic into its own class