Moved other logic to routes