cleaning up the ttbin file parsing code