refactored code into dodo