factored out mkapp into a seperate module