add applications, refactor so we can run multiple instances