refactorization and redesign