preliminary parsing logic