pulled out processing functions into own file