not working inthe middle of refactorng