Refactor application installation