added setAsApplication
Fixed formatation.