Implement new getFunction and getOrInsertFunction methods