Refactoring create OAuth apps