changed routing and refactored