refactor detail.dart