implement sorting by namespace