moved flux methods into their own file