cleans up router of unused routes