semi-polished app code