Fix upload app info and refactoring code