small factorizing of function