adding dependency to routd and removing some redundant code