refactor: as a class