refactoring & rewriting