Add pending test, refactor solution