moving functionality to router