refine code and add discover detail view