Refactor out router component