refactor and complete router module