updated, fixed and cleaned app code