Extract duplicated code into common module
DRY up routes