refactor detail parsing