refactor out to header file