[ refactor ] Added argument for default value to invertP