new apporach using class to route