Refactored incorrect logic