Added router and refactored structure