purify function params with const