refactor(flatten): corrected documentation and function name