use functions for routing instead of hash