Gentle refactor
Reordering functions
Simplified and finally killed takeWhile