refactored to use better setup for routes