refactoring ,cap 3