Himmm... I think ideally these functions would be outside collect_data block. 

We should enable plugins to be able to define functions outside collect_data scope because some of the plugins are using functions from other plugins. 

@danielsdeleo will have a good idea about the right thing here :)