refactored tables routes