move resource data and functions to separate object