Implemented refine by type