method to return picklable version