Refactoring actions and routes