refactoring and reimplementing...