refactoring and revisiting code