Refactoring drunkenness algorithm