Refactored app as an example