extracted logic into its own class
More refactoring