refactoring; small modifications