cleaned app init code