refactoring(not working)