refactor Actions and Routes