Refactoring app insert