simplified parsing logic