refactored. added route class