refactore application creation