removing extra flatten and anon func param number