remove mask argument from inner function