some work to refactor routes functions prototypes