implemented general routing structure