app builder script refactored