refactor out 'usage' function