Simplify takeWhile